<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let isSending = false
    let xhr = null
    onkeypress=function (){

        if (isSending){
            xhr.abort()
        }
         xhr = new XMLHttpRequest()
        isSending = true
        xhr.open('post','http://127.0.0.1:8000/network')
        xhr.send()
        xhr.onreadystatechange = function (){
            if (xhr.readyState === 4){
                isSending = false
            }
        }
    }
</script>
</body>
</html>